home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / Other Langs / Tickle-4.0 (tcl) / library / help / tcl / control / foreach < prev    next >
Encoding:
Text File  |  1993-10-26  |  702 b   |  19 lines  |  [TEXT/$Tcl]

  1.  
  2.           foreach varname list body
  3.  
  4.  
  5.      DESCRIPTION
  6.           In this command varname is the name of a variable, list is a
  7.           list  of  values  to  assign  to  varname, and body is a Tcl
  8.           script.  For each element of list (in  order  from  left  to
  9.           right), foreach assigns the contents of the field to varname
  10.           as if the lindex command had been used to extract the field,
  11.           then  calls  the Tcl interpreter to execute body.  The break
  12.           and continue statements may be invoked inside body, with the
  13.           same effect as in the for command.  Foreach returns an empty
  14.           string.
  15.  
  16.  
  17.      KEYWORDS
  18.           foreach, iteration, list, looping
  19.